<?php declare(strict_types=1);


namespace App;

use Swoft\Bean\Annotation\Mapping\Bean;
use Swoft\Rpc\Client\Contract\ExtenderInterface;
use UntilDistributed\TxId;

/**
 * Class Extender
 * rpc 请求额外数据
 * @since 2.0
 * @Bean(name="rpcClientExtender")
 */
class RpcExtender implements ExtenderInterface
{
	
	/**
	 * @return array
	 * @throws \Swoft\Exception\SwoftException
	 */
	public function getExt(): array
	{
		return [
				'x_id' => TxId::getInstance()->pop()
		];
	}
}